# Maintainer: Jelle van der Waa <jelle@archlinux.org>

pkgname=sscg
pkgver=3.0.5
pkgrel=1
pkgdesc="Simple Signed Certificate Generator"
url="https://github.com/sgallagher/sscg"
license=('GPL')
arch=(loong64 x86_64)
depends=(openssl popt talloc ding-libs)
makedepends=(git help2man meson)
source=(git+https://github.com/sgallagher/sscg.git?signed#tag=${pkgname}-${pkgver})
# https://github.com/sgallagher.gpg
validpgpkeys=('850A9DD1DBF2ACCC6FC4949145DB85A568286D11')
sha512sums=('SKIP')

build() {
  cd $pkgname
  meson --prefix=/usr \
        --buildtype plain \
        --auto-features enabled \
        -D b_lto=true \
        -D b_pie=true \
  build
  ninja -C build
}

check() {
  cd $pkgname
  meson test -C build --print-errorlogs
}

package() {
  cd $pkgname
  DESTDIR="${pkgdir}" meson install -C build
}
